package com.uzai.common.enums;

/**
 * 群发消息状态
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum GroupSendStatusEnum {
    INIT(-1,"初始化"),
    NOT_START(0,"未开始"),
    RUNNING(1,"进行中"),
    PAUSE(2,"暂停"),
    FINISH(3,"完成"),
    INVALID(4,"过期"),
    NIGHT_STOP(5,"夜间暂停");


    public static final int INIT_VALUE = -1;
    public static final int NOT_START_VALUE = 0;
    public static final int RUNNING_VALUE = 1;
    public static final int PAUSE_VALUE = 2;
    public static final int FINISH_VALUE = 3;
    public static final int INVALID_VALUE = 4;
    public static final int NIGHT_STOP_VALUE = 5;

    private Integer value;
    private String desc;

    GroupSendStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static GroupSendStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (GroupSendStatusEnum type: GroupSendStatusEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
